/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Forms;

import DTO.DTObenhnhan;
import java.awt.Component;
import java.awt.ItemSelectable;
import java.awt.event.ItemEvent;
import javax.swing.JOptionPane;

/**
 *
 * @author Documents
 */
public class DangKyKhamBenh extends javax.swing.JFrame {

    /**
     * Creates new form DangKyKhamBenh
     */
    public DangKyKhamBenh() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jtextfMabn = new javax.swing.JTextField();
        jtextfTen = new javax.swing.JTextField();
        jtextfDienthoai = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jcbNgaysinh = new javax.swing.JComboBox();
        jcbThangsinh = new javax.swing.JComboBox();
        jcbNamsinh = new javax.swing.JComboBox();
        jtextfDiachi = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jrdNam = new javax.swing.JRadioButton();
        jrdNu = new javax.swing.JRadioButton();
        jLabel13 = new javax.swing.JLabel();
        jrdCobh = new javax.swing.JRadioButton();
        jrdKhongbh = new javax.swing.JRadioButton();
        jlbMabh = new javax.swing.JLabel();
        jtextfMabh = new javax.swing.JTextField();
        jcheckboxVuottuyen = new javax.swing.JCheckBox();
        jtextfTuoi = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jtextfCmnd = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        jLabel18 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jtextaTiensu = new javax.swing.JTextArea();
        jPanel3 = new javax.swing.JPanel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jComboBox4 = new javax.swing.JComboBox();
        jComboBox5 = new javax.swing.JComboBox();
        jPanel4 = new javax.swing.JPanel();
        jLabel23 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jtextfNhanvientruc = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        jtextfPhidv = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        jcbNgay = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        jcbThang = new javax.swing.JComboBox();
        jLabel11 = new javax.swing.JLabel();
        jcbNam = new javax.swing.JComboBox();
        jPanel5 = new javax.swing.JPanel();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        btnSave = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(255, 204, 255));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(0, 102, 0));
        jLabel1.setText("ĐĂNG KÝ KHÁM BỆNH");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(null, new java.awt.Color(102, 204, 0)), "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(51, 204, 0)));

        jLabel2.setText("Mã BN");

        jLabel3.setText("Họ tên");

        jLabel4.setText("Điện thoại");

        jLabel5.setText("Địa chỉ");
        jLabel5.setToolTipText("");

        jtextfMabn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtextfMabnActionPerformed(evt);
            }
        });
        jtextfMabn.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtextfMabnKeyReleased(evt);
            }
        });

        jtextfTen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtextfTenActionPerformed(evt);
            }
        });
        jtextfTen.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtextfTenKeyReleased(evt);
            }
        });

        jtextfDienthoai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtextfDienthoaiActionPerformed(evt);
            }
        });

        jLabel7.setText("Ngày sinh");

        jcbNgaysinh.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Ngày", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));
        jcbNgaysinh.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jcbNgaysinhItemStateChanged(evt);
            }
        });
        jcbNgaysinh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbNgaysinhActionPerformed(evt);
            }
        });

        jcbThangsinh.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tháng", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }));

        jcbNamsinh.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Năm", "1914", "1915", "1916", "1917", "1918", "1919", "1920", "1921", "1922", "1923", "1924", "1925", "1926", "1927", "1928", "1929", "1930", "1931", "1932", "1933", "1934", "1935", "1936", "1937", "1938", "1939", "1940", "1941", "1942", "1943", "1944", "1945", "1946", "1947", "1948", "1949", "1950", "1951", "1952", "1953", "1954", "1955", "1956", "1957", "1958", "1959", "1960", "1961", "1962", "1963", "1964", "1965", "1966", "1967", "1968", "1969", "1970", "1971", "1972", "1973", "1974", "1975", "1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983", "1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014" }));
        jcbNamsinh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbNamsinhActionPerformed(evt);
            }
        });

        jtextfDiachi.setAutoscrolls(false);
        jtextfDiachi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtextfDiachiActionPerformed(evt);
            }
        });

        jLabel8.setText("Tuổi");

        jLabel10.setText("Giới tính");

        buttonGroup1.add(jrdNam);
        jrdNam.setText("Nam");
        jrdNam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrdNamActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrdNu);
        jrdNu.setText("Nữ");

        jLabel13.setText("BHYT");

        buttonGroup2.add(jrdCobh);
        jrdCobh.setText("Có");
        jrdCobh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrdCobhActionPerformed(evt);
            }
        });

        buttonGroup2.add(jrdKhongbh);
        jrdKhongbh.setText("Không");
        jrdKhongbh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrdKhongbhActionPerformed(evt);
            }
        });

        jlbMabh.setText("Mã BHYT");

        jtextfMabh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtextfMabhActionPerformed(evt);
            }
        });
        jtextfMabh.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jtextfMabhKeyPressed(evt);
            }
        });

        jcheckboxVuottuyen.setText("Vượt tuyến");
        jcheckboxVuottuyen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcheckboxVuottuyenActionPerformed(evt);
            }
        });

        jtextfTuoi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtextfTuoiActionPerformed(evt);
            }
        });

        jLabel9.setText("CMND");

        jtextfCmnd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtextfCmndActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(2, 2, 2)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtextfMabn, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtextfDiachi, javax.swing.GroupLayout.PREFERRED_SIZE, 423, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtextfTuoi, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrdCobh)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jrdKhongbh)
                        .addGap(18, 18, 18)
                        .addComponent(jlbMabh)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtextfMabh, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jcheckboxVuottuyen))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtextfTen, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel7))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jcbNgaysinh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jcbThangsinh, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jcbNamsinh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jtextfDienthoai, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jLabel9))
                                    .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                                .addComponent(jrdNam)
                                                .addGap(50, 50, 50))
                                            .addComponent(jrdNu, javax.swing.GroupLayout.Alignment.TRAILING))
                                        .addGap(0, 0, Short.MAX_VALUE))
                                    .addComponent(jtextfCmnd))))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel13, jLabel2, jLabel3, jLabel4, jLabel5, jLabel7, jLabel8});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jtextfMabn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jtextfTen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jcbNgaysinh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jcbThangsinh, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jcbNamsinh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jtextfDienthoai, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(jtextfCmnd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jtextfTuoi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(jrdNam)
                    .addComponent(jrdNu))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtextfDiachi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jrdCobh)
                    .addComponent(jrdKhongbh)
                    .addComponent(jlbMabh)
                    .addComponent(jtextfMabh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jcheckboxVuottuyen))
                .addContainerGap())
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel4, jLabel8});

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(null, new java.awt.Color(102, 204, 0))));
        jPanel2.setAutoscrolls(true);

        jLabel18.setText("Tiền sử sức khỏe");

        jtextaTiensu.setColumns(20);
        jtextaTiensu.setLineWrap(true);
        jtextaTiensu.setRows(5);
        jtextaTiensu.setWrapStyleWord(true);
        jtextaTiensu.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                jtextaTiensuAncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });
        jtextaTiensu.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtextaTiensuKeyReleased(evt);
            }
        });
        jScrollPane2.setViewportView(jtextaTiensu);

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel18)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2)
                .addContainerGap())
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(78, 78, 78)
                .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(null, new java.awt.Color(102, 204, 0))));
        jPanel3.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jPanel3.setPreferredSize(new java.awt.Dimension(590, 40));

        jLabel19.setText("Phòng khám");

        jLabel20.setText("Phòng");

        jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Chọn phòng khám", "Bệnh cơ xương khớp", "Bệnh da liễu", "Bệnh mắt", "Bệnh ngoại tổng quát", "Bệnh nhiệt đới", "Bệnh nội thần kinh", "Bệnh nội tiết", "Bệnh răng hàm mặt", "Bệnh tai mũi họng", "Bệnh tiêu hoá", "Bệnh tim mạch", "Khám và chứng nhận sức khoẻ", "Ngoại thần kinh, thận niệu", "Sản phụ khoa và kế hoạch hóa gia đình" }));
        jComboBox4.setAutoscrolls(true);

        jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "A001", "A002", "A003", "A004", "A005", "A006", "A007", "A008", "A009", "A010", "A011", "A012", "A013", "A014", "A015", "A016" }));

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(2, 2, 2)
                .addComponent(jLabel19)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel20)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(jLabel20)
                    .addComponent(jComboBox4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(null, new java.awt.Color(102, 204, 0))));

        jLabel23.setText("Ngày");

        jLabel25.setText("Nhân viên trực");

        jtextfNhanvientruc.setEnabled(false);
        jtextfNhanvientruc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtextfNhanvientrucActionPerformed(evt);
            }
        });

        jLabel27.setText("Phí DV");

        jtextfPhidv.setEditable(false);
        jtextfPhidv.setEnabled(false);
        jtextfPhidv.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtextfPhidvActionPerformed(evt);
            }
        });

        jLabel28.setText("đồng");

        jcbNgay.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Ngày", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));
        jcbNgay.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbNgayActionPerformed(evt);
            }
        });

        jLabel6.setText("Tháng");

        jcbThang.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tháng", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }));

        jLabel11.setText("Năm");

        jcbNam.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Năm", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025", "2026", "2027", "2028", "2029", "2030", "2031", "2032", "2033", "2034", "2035", "2036", "2037", "2038", "2039", "2040", "2041", "2042", "2043", "2044", "2045", "2046", "2047", "2048", "2049", "2050" }));

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addComponent(jLabel23)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jcbNgay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jcbThang, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(2, 2, 2)
                .addComponent(jcbNam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(22, 22, 22)
                .addComponent(jLabel25)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtextfNhanvientruc)
                .addGap(54, 54, 54)
                .addComponent(jLabel27)
                .addGap(10, 10, 10)
                .addComponent(jtextfPhidv, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel28)
                .addContainerGap())
        );

        jPanel4Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel11, jLabel6});

        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(jLabel25)
                    .addComponent(jtextfNhanvientruc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel27)
                    .addComponent(jtextfPhidv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28)
                    .addComponent(jcbNgay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(jcbThang, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11)
                    .addComponent(jcbNam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jButton2.setText("Nhập lại");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Thoát");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("In");

        btnSave.setText("Lưu");
        btnSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSaveActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(btnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton3))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(jButton3)
                    .addComponent(jButton4)
                    .addComponent(btnSave))
                .addContainerGap(12, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                .addGap(345, 345, 345)
                .addComponent(jLabel1)
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 861, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jcbNamsinhActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbNamsinhActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jcbNamsinhActionPerformed

    private void jtextfTenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtextfTenActionPerformed
       // Nhấn enter là qua ô nhập khác
        
    }//GEN-LAST:event_jtextfTenActionPerformed

    private void jtextaTiensuKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtextaTiensuKeyReleased
        // 
    }//GEN-LAST:event_jtextaTiensuKeyReleased

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // thoát chương trình
        this.dispose();
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jtextfMabnKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtextfMabnKeyReleased
        // Nhấn enter là qua ô nhập khác
        if(evt.getKeyCode() == evt.VK_ENTER){
        jtextfMabn.transferFocus();
}
    }//GEN-LAST:event_jtextfMabnKeyReleased

    private void jtextfTenKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtextfTenKeyReleased
        // Enter cái là qua ô khác nhập
        if(evt.getKeyCode() == evt.VK_ENTER){
        jtextfTen.transferFocus(); }
    }//GEN-LAST:event_jtextfTenKeyReleased

    private void jtextfMabnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtextfMabnActionPerformed
        // TODO add your handling code here:
        
        
    }//GEN-LAST:event_jtextfMabnActionPerformed

    private void jtextfDienthoaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtextfDienthoaiActionPerformed
        // Nhấn enter là qua ô nhập khác
    }//GEN-LAST:event_jtextfDienthoaiActionPerformed

    private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
        // Cái này là nút thêm bệnh nhân :D
        // bắt đầu kiểm tra người dùng nhập đầy đủ chưa
        String gt="";
        String mabn=jtextfMabn.getText();
        String ten=jtextfTen.getText();
        String tuoi=jtextfTuoi.getText();
        String dienthoai=jtextfDienthoai.getText();
        String diachi=jtextfDiachi.getText();
        String mabh = jtextfMabh.getText();
        String cmnd = jtextfCmnd.getText();
        String tiensu=jtextaTiensu.getText();
        String nvtruc=jtextfNhanvientruc.getText();
        String phidv=jtextfPhidv.getText();
        
        if(jrdNam.isSelected()){
            gt = "Nam";}
        else if(jrdNu.isSelected())
        {
            gt = "Nữ";
        }
        
        // kết thúc kiểm tra ở đây
            
        //khởi tạo đối tượng bệnh nhân
        //DTObenhnhan dtoBenhnhan = new DTObenhnhan()
    }//GEN-LAST:event_btnSaveActionPerformed

    private void jrdNamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrdNamActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jrdNamActionPerformed

    private void jtextfTuoiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtextfTuoiActionPerformed
       
    }//GEN-LAST:event_jtextfTuoiActionPerformed

    private void jtextfDiachiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtextfDiachiActionPerformed
       
    }//GEN-LAST:event_jtextfDiachiActionPerformed

    private void jtextaTiensuAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_jtextaTiensuAncestorAdded
        
    }//GEN-LAST:event_jtextaTiensuAncestorAdded

    private void jtextfNhanvientrucActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtextfNhanvientrucActionPerformed
       
    }//GEN-LAST:event_jtextfNhanvientrucActionPerformed

    private void jtextfPhidvActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtextfPhidvActionPerformed
       
    }//GEN-LAST:event_jtextfPhidvActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        jtextfMabn.setText("");
        jtextfTen.setText("");
        jtextfCmnd.setText("");
        jtextaTiensu.setText("");
        jtextfDienthoai.setText("");
        jtextfTuoi.setText("");
        jtextfDiachi.setText("");
        jtextfMabh.setText("");
        jtextfNhanvientruc.setText("");
        jtextfPhidv.setText("");
        jrdNam.setSelected(true);
        jrdCobh.setSelected(true);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jcbNgayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbNgayActionPerformed
     
    }//GEN-LAST:event_jcbNgayActionPerformed

    private void jtextfMabhActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtextfMabhActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtextfMabhActionPerformed

    private void jtextfMabhKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtextfMabhKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtextfMabhKeyPressed

    private void jrdKhongbhActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrdKhongbhActionPerformed
        // TODO add your handling code here: 
        jtextfMabh.setEnabled(false);
        jlbMabh.setEnabled(false);
        jcheckboxVuottuyen.setEnabled(false);
    }//GEN-LAST:event_jrdKhongbhActionPerformed

    private void jrdCobhActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrdCobhActionPerformed
        // TODO add your handling code here:
        jtextfMabh.setEnabled(true);
        jlbMabh.setEnabled(true);
        jcheckboxVuottuyen.setEnabled(true);
    }//GEN-LAST:event_jrdCobhActionPerformed

    private void jcheckboxVuottuyenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcheckboxVuottuyenActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jcheckboxVuottuyenActionPerformed
    Object data;
    private void jcbNgaysinhItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jcbNgaysinhItemStateChanged
        // TODO add your handling code here:
         if(evt.getStateChange()==ItemEvent.SELECTED){
             data = jcbNgay.getSelectedItem();
            JOptionPane.showMessageDialog(null, ""+data);
        } 
    }//GEN-LAST:event_jcbNgaysinhItemStateChanged

    private void jcbNgaysinhActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbNgaysinhActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jcbNgaysinhActionPerformed

    private void jtextfCmndActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtextfCmndActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtextfCmndActionPerformed

    //check input
    private boolean checkInput(){
        if(jtextfMabn.getText().trim().equals("")){
            JOptionPane.showMessageDialog(null,"Vui lòng nhập mã bệnh nhân");
        }
        else if(jtextfTen.getText().trim().equals("")){
            JOptionPane.showMessageDialog(null,"Vui lòng nhập họ tên");
        }
        else if(jtextfDienthoai.getText().trim().equals("")){
            JOptionPane.showMessageDialog(null,"Vui lòng nhập số điện thoại");
        }
         else if(jtextfCmnd.getText().trim().equals("")){
            JOptionPane.showMessageDialog(null,"Vui lòng nhập số chứng minh thư");
        }
        else if(jtextfTuoi.getText().trim().equals("")){
            JOptionPane.showMessageDialog(null,"Vui lòng nhập tuổi");
        }
        else if(jtextfDiachi.getText().trim().equals("")){
            JOptionPane.showMessageDialog(null,"Vui lòng nhập địa chỉ");
        }
        else if(jtextaTiensu.getText().trim().equals("")){
            JOptionPane.showMessageDialog(null,"Vui lòng nhập tiền sử bệnh");
        }
        
        else if(jtextfPhidv.getText().trim().equals("")){
            JOptionPane.showMessageDialog(null,"Vui lòng nhập phí dịch vụ");
        }
        else if(!jrdCobh.isSelected() && !jrdKhongbh.isSelected()){
            JOptionPane.showMessageDialog(null,"Bạn có bảo hiểm không?");
        }
        else if(!jrdNam.isSelected() && !jrdNu.isSelected()){
            JOptionPane.showMessageDialog(null,"Vui lòng chọn giới tính");
        }
        else if(jrdCobh.isSelected() && jtextfMabn.getText().trim().equals("")){
            JOptionPane.showMessageDialog(null,"Chưa nhập mã bảo hiểm");
        }
        return false;
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(DangKyKhamBenh.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(DangKyKhamBenh.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(DangKyKhamBenh.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(DangKyKhamBenh.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new DangKyKhamBenh().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnSave;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JComboBox jComboBox4;
    private javax.swing.JComboBox jComboBox5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JComboBox jcbNam;
    private javax.swing.JComboBox jcbNamsinh;
    private javax.swing.JComboBox jcbNgay;
    private javax.swing.JComboBox jcbNgaysinh;
    private javax.swing.JComboBox jcbThang;
    private javax.swing.JComboBox jcbThangsinh;
    private javax.swing.JCheckBox jcheckboxVuottuyen;
    private javax.swing.JLabel jlbMabh;
    private javax.swing.JRadioButton jrdCobh;
    private javax.swing.JRadioButton jrdKhongbh;
    private javax.swing.JRadioButton jrdNam;
    private javax.swing.JRadioButton jrdNu;
    private javax.swing.JTextArea jtextaTiensu;
    private javax.swing.JTextField jtextfCmnd;
    private javax.swing.JTextField jtextfDiachi;
    private javax.swing.JTextField jtextfDienthoai;
    private javax.swing.JTextField jtextfMabh;
    private javax.swing.JTextField jtextfMabn;
    private javax.swing.JTextField jtextfNhanvientruc;
    private javax.swing.JTextField jtextfPhidv;
    private javax.swing.JTextField jtextfTen;
    private javax.swing.JTextField jtextfTuoi;
    // End of variables declaration//GEN-END:variables
}
